//脚本唯一关键字,通过该关键字找到对应脚本，每个脚本必须有该描述。
var v_script_id = 'authuserinfos_1';
//脚本状态,0:该脚本不许执行，1:该脚本可以执行
var v_status = '1';

//脚本逻辑写在run语句之间
if (run && action.getAuthority().is(5,"9")){
	var user = action.getSession().getAttribute("user");
	var authid = action.form.getInteger("authid");
	//var authkind = action.form.getInteger("authkind");
	action.vars.put(action.V_TABLE_NAME,'v_auth_user_infos');//指定获取数据的表名
	action.vars.put(action.V_MAX_LINE,'20');//每页显示多少条
	if(user.getRolekind()<3){
		action.vars.put(action.V_CONDITION, 'where authid=' + authid + ' order by id desc' );
	}else{
		action.vars.put(action.V_CONDITION, 'where authid=' + authid + 
				' and userid in(select id from h_auth_users where userid=' +user.getId() +  
				') order by id desc' );
	}
	action.vars.put(action.V_OUTPUT_FILE_FORMAT,'3');

}